<?php
$js = $this->renderPartial('js_upload',null,true);
?>
<script type='text/javascript'>
<?php echo $js ?>
</script>
<div class="form">
	<?php
	$elements = array(
		'elements' => array(
			'foto' => array(
				'type' => 'file',
				'visible'=>true,
				'class'=>'yangdiupload',
			),
		)
	);

	$multimodelform = $this->widget('ext.multimodelform.MultiModelForm', array(
		'id' => 'bahan', //the unique widget id
		'renderForm'=>'MultiModelRenderForm',
		'formConfig' => $elements, //the form configuration array
		'model' => new FormUpload(), //instance of the form model
		'validatedItems' => $validatedModel,
		'hideCopyTemplate' => false,
		'clearInputs' => true,			
		'jsRelCopy'=>'jquery.relcopy.yii.6.0Chosen.js',
		'addItemText'=>'(+) Bahan',
		'bootstrapLayout'=>true,
		'rowWrapper'=>array(
			'htmlOptions'=>array(
				//'tag'=>'div',
				'class'=>'add-item-data',
			),
		)
	),true);

	echo TbHtml::customActiveControlGroup($multimodelform, $model, '');
	
	echo TbHtml::button('Upload',array('id'=>'upload_file'));
	?>
	<input type="button" id="authorizeButton" style="display: block" value="Authorize" />
</div>